import html2canvas from 'html2canvas';
// 获取设备的Dpr值
			getDpr() {
				if (window.devicePixelRatio && window.devicePixelRatio > 1) {
					return window.devicePixelRatio;
				}
				return 1;
			},
			/**
			 * 将传入值转为整数
			 * @param value
			 * @returns {number}
			 */
			parseValue(value) {
				return parseInt(value, 10);
			},
 
            // 截图后保存到本地
			generateImage(event, ownerInstance) {
				// 获取想要转换的dom节点
				var dom = document.getElementById('container');
				html2canvas(dom, {
					// allowTaint: false,
					width: dom.clientWidth,
					height: dom.clientHeight,
					scrollY: 0,
					scrollX: 0,
					useCORS: true
				}).then(function(canv) {
					// 将canvas转换成图片渲染到页面上
					let url = canv.toDataURL('image/jpg'); // base64数据
					ownerInstance.callMethod('getSaveImg', {
						base64data: url
					})
				});
			},
 
            // 截图后分享给好友
			generateImage_Share(event, ownerInstance) {
				console.log("generateImage_Share______")
				// 获取想要转换的dom节点
				var dom = document.getElementById('container');
				html2canvas(dom, {
					// allowTaint: false,
					width: window.clientWidth,
					height: window.clientHeight,
					useCORS: true,
					dpi: 350
				}).then(function(canv) {
					// 将canvas转换成图片渲染到页面上
					let url = canv.toDataURL('image/jpg'); // base64数据
					ownerInstance.callMethod('getSaveImg_Share', {
						base64data: url,
					})
				});
			},
			
			initImage(){
				generateImage_Share(event, this);
			}